//
//  SetDefaultBankCardFooterView.m
//  NewPro
//
//  Created by RYX on 2019/4/22.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "SetDefaultBankCardFooterView.h"

@implementation SetDefaultBankCardFooterView

- (instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        [self setUI];
    }
    
    return self;
}

- (void)setUI{
    
    UIButton *btn = [[UIButton alloc] init];
    [btn addTarget:self action:@selector(onBtn:) forControlEvents:UIControlEventTouchUpInside];
    [btn setTitle:@"设为默认银行卡" forState:UIControlStateNormal];
    btn.titleLabel.font = [UIFont systemFontOfSize:16];
    btn.layer.cornerRadius = 5;
    btn.backgroundColor = BLUECOLOR;
    [self addSubview:btn];
    
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(100);
        make.left.equalTo(self).offset(29);
        make.centerX.equalTo(self);
        make.height.mas_equalTo(44);
        
    }];
}

- (void)onBtn:(UIButton *)sender{
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(onSetDefaultBankCardBtn:)]) {
        
        [self.delegate onSetDefaultBankCardBtn:sender];
    }
}
@end
